home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / recent / iib122.lha / IIB / Threads / Additional / IARexx.lha / SpiralPathsAsh.irx < prev    next >
Text File  |  1997-09-21  |  1KB  |  65 lines

  1. /*                              */
  2. /* makes a helical path */
  3. /* still needs work     */
  4. /* Ash Wyllie           */
  5.  
  6.  
  7. address 'Imagine.1'
  8. displayrexxptr on
  9. call addlib('rexxmathlib.library',0,-30,0)
  10. call addlib('rexxreqtools.library',0,-30,0)
  11. unpick all
  12.  
  13. pi = 3.14159
  14.  
  15. radius = rtgetlong(50,'Radius')
  16. if ~rtresult then call done
  17. pitch  = rtgetlong(10,'Pitch ')
  18. if ~rtresult then call done
  19. pitch  = pitch * .25
  20. turns  = rtgetlong( 3,'Turns ')
  21. if ~rtresult then call done
  22. name   = rtgetstring('SP','Path name')
  23. if ~rtresult then call done
  24. name   = upper(name)
  25. phi    = 180 / pi * atan2(pitch , .5 * pi * radius)
  26. t      = .5 * pi
  27. theta  = -90
  28.  
  29. say radius pitch turns
  30. do i=0 to (4*turns)
  31.  
  32.   addaxis
  33.   pick
  34.  
  35.   attrib.objectname = name'.'i
  36.   setattributes objectname
  37.   tangle =  t * i
  38.   x = radius * cos(tangle)
  39.   y = radius * sin(tangle)
  40.   z= pitch * i
  41.   theta = 90 + theta
  42.  
  43.   transform_alignment phi 0 theta
  44.   transform_position x y z
  45.  
  46. end
  47.  
  48. unpick all
  49.  
  50. multipickon
  51. do i = 0 to (4*turns)
  52.  pick name'.'i
  53. end
  54. multipickoff
  55.  
  56. makepath
  57.  
  58. groupmode
  59. attrib.objectname = name
  60. setattributes objectname
  61.  
  62. done:
  63. displayrexxptr off
  64. exit
  65.